package com.sds.shop.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.MemDAO;
import com.sds.shop.dao.ReplyDAO;
import com.sds.shop.vo.MemVO;
import com.sds.shop.vo.SessionVO;

public class ReplyRegistAction extends Action{
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		String board_no = request.getParameter("board_no");
		String reply = request.getParameter("reply");		
		MemVO mem = MemDAO.getInstance().getCustomer(((SessionVO)request.getSession().getAttribute("user")).getMemId());
		
		ReplyDAO.getInstance().registReply(board_no, reply, mem);
		HttpUtil.forward(request, response, "boardDetail.do?board_no=" + board_no);
	}
}
